package service.configuration.xstream;

import service.configuration.IFieldTextConfig;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.basic.BooleanConverter;
import com.thoughtworks.xstream.converters.basic.IntConverter;

@XStreamAlias("text")
public class FieldTextConfig extends FieldStringConfig implements IFieldTextConfig {
	@XStreamConverter(value=IntConverter.class)
	private Integer maxp;
	@XStreamConverter(value=IntConverter.class)
	private Integer minp;
	@XStreamConverter(value=IntConverter.class)
	private Integer minol;
	@XStreamConverter(value=IntConverter.class)
	private Integer maxol;
	@XStreamConverter(value=IntConverter.class)
	private Integer minul;
	@XStreamConverter(value=IntConverter.class)
	private Integer maxul;
	@XStreamConverter(value=IntConverter.class)
	private Integer minl;
	@XStreamConverter(value=IntConverter.class)
	private Integer maxl;
	@XStreamConverter(value=BooleanConverter.class, booleans={false}, strings={"true", "false"})
	private boolean containsTable;
	
	public FieldTextConfig(Integer minchar, Integer maxchar, String regex, 
			Integer minParagraph, Integer maxParagraph, 
			Integer minOrderedList, Integer maxOrderedList, 
			Integer minUnorderedList, Integer maxUnorderedList, 
			Integer minList, Integer maxList, 
			boolean constainsTable) {
		
		super(minchar, maxchar, regex);
		this.maxp = maxParagraph;
		this.minp = minParagraph;
		this.minol = minOrderedList;
		this.maxol = maxOrderedList;
		this.minul = minUnorderedList;
		this.maxul = maxUnorderedList;
		this.minl = minList;
		this.maxl = maxList;
		this.containsTable = constainsTable;
	}

	public Integer getMaxParagraph() {
		return maxp;
	}

	public void setMaxParagraph(Integer maxp) {
		this.maxp = maxp;
	}

	public Integer getMinParagraph() {
		return minp;
	}

	public void setMinParagraph(Integer minp) {
		this.minp = minp;
	}

	public Integer getMinOrderedList() {
		return minol;
	}

	public void setMinOrderedList(Integer minol) {
		this.minol = minol;
	}

	public Integer getMaxOrderedList() {
		return maxol;
	}

	public void setMaxOrderedList(Integer maxol) {
		this.maxol = maxol;
	}

	public Integer getMinUnorderedList() {
		return minul;
	}

	public void setMinUnorderedList(Integer minul) {
		this.minul = minul;
	}

	public Integer getMaxUnorderedList() {
		return maxul;
	}

	public void setMaxUnorderedList(Integer maxul) {
		this.maxul = maxul;
	}

	public Integer getMinList() {
		return minl;
	}

	public void setMinList(Integer minl) {
		this.minl = minl;
	}

	public Integer getMaxList() {
		return maxl;
	}

	public void setMaxList(Integer maxl) {
		this.maxl = maxl;
	}

	public boolean containsTable() {
		return containsTable;
	}

	public void setContainsTable(boolean containsTable) {
		this.containsTable = containsTable;
	}
}
